﻿<DemoPageSectionComponent Id="Editors-CheckBox-Switch" ShowSizeMode="true">
    <ChildContentWithParameters Context="Params">
        <div class="card">
            <ul class="list-group list-group-flush">
                <li class="list-group-item">
                    <DxCheckBox CheckType="CheckType.Switch"
                                LabelPosition="LabelPosition.Left"
                                Checked="@SilentMode"
                                CheckedChanged="@((bool t) => CheckedChanged(t))"
                                Alignment="CheckBoxContentAlignment.SpaceBetween"
                                SizeMode="Params.SizeMode">
                        Silent Mode
                    </DxCheckBox>
                </li>
                <li class="list-group-item">
                    <DxCheckBox CheckType="CheckType.Switch"
                                LabelPosition="LabelPosition.Left"
                                @bind-Checked="@Sound"
                                Enabled="@Enabled"
                                Alignment="CheckBoxContentAlignment.SpaceBetween"
                                SizeMode="Params.SizeMode">
                        Enable Sound
                    </DxCheckBox>
                </li>
                <li class="list-group-item">
                    <DxCheckBox CheckType="CheckType.Switch"
                                LabelPosition="LabelPosition.Left"
                                @bind-Checked="@Vibration"
                                Enabled="@Enabled"
                                Alignment="CheckBoxContentAlignment.SpaceBetween"
                                SizeMode="Params.SizeMode">
                        Enable Vibration
                    </DxCheckBox>
                </li>
            </ul>
        </div>
    </ChildContentWithParameters>

    @code {
        bool Enabled { get; set; } = false;

        bool SilentMode { get; set; } = true;
        bool Sound { get; set; } = true;
        bool Vibration { get; set; } = false;

        void CheckedChanged(bool value) {
            SilentMode = value;
            Enabled = !value;
        }
    }
</DemoPageSectionComponent>
